package com.gxa.adput.controller;

import com.gxa.adput.service.AdPutService;
import com.gxa.common.entity.platform_maintenance_service1001.AdPut;
import com.gxa.common.result.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/adPut")
public class AdPutController {

    @Autowired
    public AdPutService adPutService;

    /**
     * 1.添加广告通知
     * @param adPut
     * @return
     */
    @PostMapping("/addAdPut")
    public R addAdPut(@RequestBody AdPut adPut){
        return adPutService.addAdPut(adPut);
    }


    /**
     * 2.修改广告通知
     * @param adPut
     * @return
     */
    @PostMapping("/updateAdPut")
    public R updateAdPut(@RequestBody AdPut adPut){
        return adPutService.updateAdPut(adPut);
    }

    /**
     * 3.根据分页查询广告通知
     * @param currentPage
     * @param pageSize
     * @return
     */
    @GetMapping("/selectAdPut")
    public R selectAdPut(Integer currentPage,Integer pageSize){
        return adPutService.selectAdPut(currentPage,pageSize);

    }

    /**
     * 4.根据条件查询
     * @param currentPage
     * @param pageSize
     * @return
     */
    @GetMapping("/selectAdPutByCondition")
    public R selectAdPutByCondition(Integer currentPage,Integer pageSize,AdPut adPut){

        return adPutService.selectAdPutByCondition(currentPage,pageSize,adPut);
    }


    /**
     * 5.根据id来删除信息
     * @param adPut
     * @return
     */
    @PostMapping("/delAdPutById")
    public R delAdPutById(@RequestBody AdPut adPut){
        return adPutService.delAdPutById(adPut);
    }



}
